<?php
        include_once("../../libs/bn_path.php");
        $cap=new bn_captcha();
        $gf=new bn_genralfunc();
        $cap->noise=200;
        $cap->line=3;
        ini_set('session.hash_function','sha386');
        ini_set('session.hash_bits_per_character',6);
        ini_set('session.cookie_httponly',1);//prevent xss
        ini_set('session.entropy_file', "/dev/urandom");//(better entropy source)
        ini_set('session.cookie_lifetime', 0 );
        session_save_path(basepath.'/files/temp');
        session_start();
        session_regenerate_id(true);
        $text=$gf->RandomStrgenerate(5);
        $_SESSION["captcha"]=strtolower($text);
        $cap->Create_captcha_line($text);
        ?>